#! /usr/bin/env python
# -*- coding:utf-8 -*-
# Author Jmz


# 1、算数运算
print(1 + 2)     # 3
print(1 * 2)     # 2
print(10 % 4)    # 2
print(10 / 4)    # 2.5
print(10 // 4)    # 2    # 返回商的整数部分


# 2、运算符
print('a' == 'a')  # True
print('a' != 'b')  # True
print(3 > 4)        # False
print(3 < 4)        # True



# 赋值运算符
a = 1      # a = 1
a += 3     # a = 4
a -= 1     # a = 3
a *= 5     # a = 15
a /= 3     # a = 5    // 数据类型变成了 float
a %= 2     # a = 1
print(a,type(a))   # 1.0  float



# 逻辑运算符
# 三者的优先级从高到低分别是：not，or，and
print(3>4 or 4 >3 and True)   # True
print(4 > 3 and 3<4 or True)  #True
print(4>3 and 3 < 4 or not 1 == 2)  # True



